<script>
import {getRichTextInfo} from '@/api/material/index';
export default {
  name:'',
  component:{},
  data: function () {
    return {
      msg: '加载中....',
      id: this.$route.query.id
    }


  },

  watch: {
    $route: function (e, t) {
      e.query.id !== t.query.id && (this.id = e.query.id, this.msg = '', this.getRichTextInfoLocal());
    }
  },

  mounted: function () {
    this.id = this.$route.query.id;
    this.getRichTextInfoLocal();
  },
  methods: {
    getRichTextInfoLocal: function () {
      var e = this;
      getRichTextInfo(this.id).then(function (t) {
        null == t.data ? e.msgInfo('找不到对应的信息') : e.msg = t.data.editorContent;
      }).catch(function (t) {
        e.msgError(t);
      });
    }
  }

}
</script>

<template>
  <div>
    <p style="padding: 2rem" v-html="msg"></p>
  </div>
</template>
